# Contributor: Pascal Hofmann <mail@pascalhofmann.de>
# Contributor: Mickaël Remars <github@remars.com>
# Maintainer: Mickaël Remars <github@remars.com>
_pkgreal=rrd
pkgname=php7-pecl-rrd
pkgver=2.0.3
pkgrel=0
pkgdesc="PHP7 bindings to rrd tool system"
url="https://pecl.php.net/package/rrd"
arch="all"
license="BSD-2-Clause" # just one word difference: "owner" in php-rrd's license, "holder" in bsd-2-clause
depends="php7-common"
makedepends="php7-dev re2c rrdtool-dev"
checkdepends="rrdtool"
source="$pkgname-$pkgver.tgz::http://pecl.php.net/get/$_pkgreal-$pkgver.tgz"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	phpize7
	./configure --prefix=/usr --with-php-config=php-config7
	make
}

check() {
	make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 test
}

package() {
	local confdir="$pkgdir/etc/php7/conf.d"

	make INSTALL_ROOT="$pkgdir" install

	mkdir -p "$confdir"
	echo "extension=$_pkgreal.so" > "$confdir"/20_$_pkgreal.ini
}

sha512sums="28679ccead54806d1e92accc6f5ebab582a41db802f95797ddb43e3e15690889be3437f22e2a14939d217422ac2700ef90ae0a9b36244ddead3856343b3e09b4  php7-pecl-rrd-2.0.3.tgz"
